package com.xx.job.orderhystrix80.controller;

import com.xx.job.common.CommonResult;
import com.xx.job.orderhystrix80.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {

    @Autowired
    private PaymentService paymentService;

    @RequestMapping("/consumer/hystrix/ok/{id}")
    public CommonResult histrixOk(@PathVariable String id){
       return paymentService.histrixOk(id);
    }

    @RequestMapping("/consumer/hystrix/timeout/{id}")
    public CommonResult histrixTimeOut(@PathVariable String id){
        return  paymentService.histrixTimeOut(id);
    }
}
